package com.sky.service.impl;

import com.sky.service.ShopService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class ShopServicelmpl implements ShopService {
    @Autowired
    private RedisTemplate redisTemplate;

    public int getStatus() {
        ValueOperations operations = redisTemplate.opsForValue();
        return (int) operations.get("shop");
    }

    public void gaiStatus(int status) {
        ValueOperations operations = redisTemplate.opsForValue();
        operations.set("shop", status);
    }
}
